﻿using System;
using Autofac;
using ShuttleBus.Config;

namespace ShuttleBus.Transports.Msmq
{
    public static class ConfigurationExtensions
    {
        public static TransportConfiguration ForMsmq(this Configuration configuration, int threadCount, int secondsToProcessMessage, Uri transportUri)
        {
            var builder = new ContainerBuilder();
            builder.RegisterModule(new MsmqModule(threadCount, transportUri, secondsToProcessMessage));
            builder.Update(UnitOfWork.Instance.ApplicationContainer);

            return new TransportConfiguration();
        }
    }
}